EfFieldFormatter
class EfFieldFormatter implements IteratorAggregate, Countable
Base class for Entity fields. Extend this class to implement custom field formatter.
Methods
Constructor.
Returns the current field item as a raw array.
Returns all raw field items in an array.
Returns an array of all field items as EfFieldFormatter objects.
Set the current field delta.
Checks if the given or current field delta exists.
Shortcut for the possible not so easy to understand isDeltaValid() method.
Check if current user is allowed to view this field.
Implementing IteratorAggregate interface.
Implementing Countable interface.
Details
at line 23
__construct(EntityMetadataWrapper $property, bool $isMultivalue)
Constructor.
at line 43
array|string
value()
Returns the current field item as a raw array.
at line 52
array
values()
Returns all raw field items in an array.
at line 61
EfFieldFormatter[]
all()
Returns an array of all field items as EfFieldFormatter objects.
at line 74
array
setDelta($delta)
Set the current field delta.
at line 91
bool
isDeltaValid(null $delta = NULL)
Checks if the given or current field delta exists.
at line 102
bool
notEmpty()
Shortcut for the possible not so easy to understand isDeltaValid() method.
at line 113
bool
isAccessible()
Check if current user is allowed to view this field.
Can be needed if a module like field_permissions is in use.
at line 124
EfFieldFormatterIterator
getIterator()
Implementing IteratorAggregate interface.
If we wrap a list, we return an iterator over the data list.
at line 133
int
count()
Implementing Countable interface.